"use strict";
cc._RF.push(module, '82617cFSDxLJJ+b30QJLTlY', 'PlayerModel');
// script/model/PlayerModel.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.GameConfig = exports.ImageData = exports.AreaInfo = exports.ShowroomInfo = exports.Player = exports.ShowroonStyle = exports.ShowroomType = void 0;
var BaseModel_1 = require("../../libs/lightMVC/core/base/BaseModel");
var Notification_1 = require("../Notification");
var ShowroomType;
(function (ShowroomType) {
    ShowroomType[ShowroomType["No"] = 0] = "No";
    ShowroomType[ShowroomType["Match"] = 1] = "Match";
    ShowroomType[ShowroomType["Person"] = 2] = "Person";
})(ShowroomType = exports.ShowroomType || (exports.ShowroomType = {}));
var ShowroonStyle;
(function (ShowroonStyle) {
    ShowroonStyle[ShowroonStyle["Industrial"] = 1] = "Industrial";
    ShowroonStyle[ShowroonStyle["Postmodernism"] = 2] = "Postmodernism";
    ShowroonStyle[ShowroonStyle["DreamCastle"] = 3] = "DreamCastle";
})(ShowroonStyle = exports.ShowroonStyle || (exports.ShowroonStyle = {}));
var PlayerModel = /** @class */ (function (_super) {
    __extends(PlayerModel, _super);
    function PlayerModel() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._isBack = false;
        return _this;
    }
    PlayerModel.prototype.init = function () {
        console.log("初始化用户数据模块");
        this._player = new Player("");
        this._showroom = new ShowroomInfo(0);
        this._gameConfig = new GameConfig();
    };
    /**
     * 当前用户拥有美术馆
     */
    PlayerModel.prototype.ownGallery = function (own) {
        this._player.ownGallery = own;
        this.sendNoti(Notification_1.default.OWN_GALLERY);
    };
    PlayerModel.prototype.getPlayer = function () {
        return this._player;
    };
    PlayerModel.prototype.getShowroomInfo = function () {
        return this._showroom;
    };
    /**
     * 当前打开的图片
     */
    PlayerModel.prototype.getOpenedImageDetail = function () {
        this.debugOpenedImageDetail(); //测试数据
        return this._player.openedImageDetail;
    };
    /**
     * 这里是测试信息
     */
    PlayerModel.prototype.debugOpenedImageDetail = function () {
        var t_image = new ImageData();
        t_image.id = 0;
        t_image.title = "梵高星空  星月夜";
        t_image.introduceContent = "在这幅画中，梵·高用夸张的手法，生动地描绘了充满运动和变化的星空。夜晚的天空高又远，大星、小星回旋于夜空，金黄的满月形成巨大的漩涡，星云的短线条纠结、盘旋，仿佛让人们看见时光的流逝。暗绿褐色的柏树像巨大的火焰，是星夜狂欢的响应者。天空下，安睡的村庄那么宁静、安详。淡蓝的色调，动感的线条，给人自由的时空感";
        t_image.url = "http://h5files.oss-cn-hangzhou.aliyuncs.com/artGallery/test/%E6%98%9F%E7%A9%BA.jpg";
        this._player.openedImageDetail = t_image;
    };
    /**
     * 切换音乐播放状态
     * @param isPlaying 音乐的播放状态
     */
    PlayerModel.prototype.musicStateChange = function (isPlaying) {
        this._gameConfig.musicIsPlaying = isPlaying;
        if (isPlaying) {
            this.sendNoti(Notification_1.default.MUSIC_PLAYING);
        }
        else {
            this.sendNoti(Notification_1.default.MUSIC_PAUSE);
        }
    };
    PlayerModel.prototype.clear = function () {
    };
    return PlayerModel;
}(BaseModel_1.default));
exports.default = PlayerModel;
/**
 * 游戏中基础信息
 */
var Player = /** @class */ (function () {
    function Player(openid) {
        this.ownGallery = false; //是否拥有美术馆
        this.likeworks = []; //用户的点赞作品集
        this.areaInfoList = []; //用户所拥有的的区域和信息
        this.showcaseImageList = []; //存放单张图片信息的列表
        this._curShowcaseId = ""; //当前展示区的ID
        this.openid = openid;
        //this.writeDebugData();
    }
    Object.defineProperty(Player.prototype, "curShowcaseId", {
        get: function () {
            return this._curShowcaseId;
        },
        set: function (value) {
            this._curShowcaseId = value;
        },
        enumerable: false,
        configurable: true
    });
    return Player;
}());
exports.Player = Player;
/** 定义美术馆的基础信息 */
var ShowroomInfo = /** @class */ (function () {
    function ShowroomInfo(id) {
        this.showroomType = ShowroomType.No; //赛馆类型
        this.showroomStyle = ShowroonStyle.Postmodernism; // 展馆类型工业风
        this.texturecurindex = 0;
        //这里是测试数据  189
        this.id = id;
    }
    return ShowroomInfo;
}());
exports.ShowroomInfo = ShowroomInfo;
/**
 * 用户所拥有的的区域和信息
 */
var AreaInfo = /** @class */ (function () {
    function AreaInfo(name, id, styleid) {
        this.name = name;
        this.exh_id = id;
        this.styleid = styleid;
    }
    return AreaInfo;
}());
exports.AreaInfo = AreaInfo;
/**
 * 单张图片的信息
 */
var ImageData = /** @class */ (function () {
    function ImageData() {
        this.likeCount = 0; //当前作品的点赞数量
    }
    return ImageData;
}());
exports.ImageData = ImageData;
/**
 * 用户所拥有的的区域和信息
 */
var GameConfig = /** @class */ (function () {
    function GameConfig() {
        this.musicIsPlaying = true; //背景音乐是否正在播放
    }
    return GameConfig;
}());
exports.GameConfig = GameConfig;

cc._RF.pop();